<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .abc-enter-active,
      .abc-leave-active {
        transition: all 1s;
      }

      .abc-enter-from {
        transform: translateX(100%);
      }
      .abc-leave-to {
        transform: translateX(-100%);
      }
    </style>
  </head>
  <body>
    <div id="app">
      <h2>过渡模式</h2>
      <button @click="show = !show">btn</button>

      <br />

      <!-- mode表示过度模式，out-in是先出后进，in-out是先进后出 -->
      <transition name="abc" mode="in-out">
        <button v-if="show">on</button><button v-else>off</button>
      </transition>
    </div>

    <script src="./lib/Vue3.js"></script>
    <script>
      const { createApp } = Vue;

      createApp({
        data() {
          return {
            show: true,
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
